package com.chag.app.biz.dao.gen;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface JobMapper {
    int countByExample(JobCriteria example);

    int deleteByExample(JobCriteria example);

    @Delete({
        "delete from JOB",
        "where JOB_ID = #{jobId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer jobId);

    @Insert({
        "insert into JOB (JOB_ID, BIZ_ID, ",
        "JOB_CAT_ID, POST_TIME, ",
        "AREA, SALARY_BEGIN, ",
        "SALARY_END, EXP_DATE, ",
        "JOB_DETAIL)",
        "values (#{jobId,jdbcType=INTEGER}, #{bizId,jdbcType=INTEGER}, ",
        "#{jobCatId,jdbcType=INTEGER}, #{postTime,jdbcType=TIMESTAMP}, ",
        "#{area,jdbcType=VARCHAR}, #{salaryBegin,jdbcType=INTEGER}, ",
        "#{salaryEnd,jdbcType=INTEGER}, #{expDate,jdbcType=TIMESTAMP}, ",
        "#{jobDetail,jdbcType=VARCHAR})"
    })
    int insert(Job record);

    int insertSelective(Job record);

    List<Job> selectByExample(JobCriteria example);

    @Select({
        "select",
        "JOB_ID, BIZ_ID, JOB_CAT_ID, POST_TIME, AREA, SALARY_BEGIN, SALARY_END, EXP_DATE, ",
        "JOB_DETAIL",
        "from JOB",
        "where JOB_ID = #{jobId,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    Job selectByPrimaryKey(Integer jobId);

    int updateByExampleSelective(@Param("record") Job record, @Param("example") JobCriteria example);

    int updateByExample(@Param("record") Job record, @Param("example") JobCriteria example);

    int updateByPrimaryKeySelective(Job record);

    @Update({
        "update JOB",
        "set BIZ_ID = #{bizId,jdbcType=INTEGER},",
          "JOB_CAT_ID = #{jobCatId,jdbcType=INTEGER},",
          "POST_TIME = #{postTime,jdbcType=TIMESTAMP},",
          "AREA = #{area,jdbcType=VARCHAR},",
          "SALARY_BEGIN = #{salaryBegin,jdbcType=INTEGER},",
          "SALARY_END = #{salaryEnd,jdbcType=INTEGER},",
          "EXP_DATE = #{expDate,jdbcType=TIMESTAMP},",
          "JOB_DETAIL = #{jobDetail,jdbcType=VARCHAR}",
        "where JOB_ID = #{jobId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Job record);
}